package lee.meiriyiti.day1119;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;

public class TestDemo1119_2 {
    //思路
    // replaceAll方法
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            char[] str1 = scanner.nextLine().toCharArray();
            String str2 = scanner.nextLine();
            for (int i = 0; i < str1.length; i++) {
                if (!str2.contains(String.valueOf(str1[i]))){
                    System.out.print(str1[i]);
                }
            }
        }
    }

    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String s1 = scanner.nextLine();
            String s2 = scanner.nextLine();
            String tmp = "[" + s2 + "]";
            String result = s1.replaceAll(tmp, "");
            System.out.println(result);
        }
    }

    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string1 = scanner.nextLine();
        String string2 = scanner.nextLine();
        HashMap<Character, Integer> str2 = new HashMap<>();
        for (int i = 0; i < string1.length(); i++) {
            str2.put(string1.charAt(i), 0);
        }
        for (int i = 0; i < string2.length(); i++) {
            str2.put(string2.charAt(i), 1);
        }
        ArrayList<Character> list = new ArrayList<>();
        for (int i = 0; i < string1.length(); i++) {
            if (str2.get(string1.charAt(i)) == 0) {
                list.add(string1.charAt(i));
            }
        }
        String str = new String();
        for (int i = 0; i < list.size(); i++) {
            str += list.get(i);
        }
        System.out.println(str);
    }
}

